import pygame

def get_tile_graphic(index,w,h,tileset):
	final_surface = pygame.Surface((w,h))
	final_surface.set_colorkey((255,0,255))
	for i in range(0,w):
		for j in range(0,h):
			final_surface.set_at((i,j),tileset.get_at((index*w+i,j)))
	return final_surface